<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* float:元素相对于页面 漂浮 起来了 */
        /* 对后面的元素造成了影响   解决：清除浮动clear:both; */
        .one{
            width: 100px;
            height: 100px;
            background-color: red;
            float: left;
        }
        .two{
            width: 200px;
            height: 200px;
            background: cyan;
            float: left;
        }
        .three{
            width: 300px;
            height: 300px;
            background-color: darkmagenta;
            clear: both;   /*清除浮动*/
        }

        .parent{
            width: 200px;
            background-color: darkturquoise;
            overflow: hidden;  /*解决父元素高度坍塌问题*/
        }
        .child{
            width: 100px;
            height: 100px;
            background-color: darkorchid;
            float: left;
        }
        .four{
            width: 200px;
            height: 200px;
            background-color: gold;
        }
    </style>
</head>
<body>
    <div class="one"></div>
    <div class="two"></div>
    <div class="three"></div>

    <div class="parent">
        <div class="child"></div>
    </div>
    <div class="four"></div>
</body>
</html>